package com.jic.order.mapper;

import com.alibaba.fastjson.JSONObject;
import com.jic.order.entity.OrderGoods;
import com.jic.order.response.HotProductResponse;
import com.jic.order.response.OrderGoodsResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单商品明细表
 *
 * @author : yinhaijun
 * @version : v1.0.0
 * @email :
 * @since : 2020-01-13 08:52:20
 */
@Mapper
public interface OrderGoodsMapper {

	long insert(OrderGoods orderGoods);

	long update(OrderGoods orderGoods);

	OrderGoods queryByPrimaryKey(Long id);

	List<String> queryOrderNoByGoodsName(String goodsName);

	List<OrderGoods> query(OrderGoods orderGoods);

	OrderGoods queryGoodsDetails(OrderGoods orderGoods);

	List<OrderGoods> queryPage(@Param("startIndex") int startIndex, @Param("limit") int limit, @Param("orderGoods") OrderGoods orderGoods);

	long queryPageCount(OrderGoods orderGoods);

	/**
	 * description: 根据商品ID查询商品销量
	 *
	 * @return 商品销量
	 * @author: jackHe
	 * @time: 2020/8/8 14:30
	 */
	Integer queryProductSalesByProductId(@Param("productIds") List<Long> productIds);

	/**
	 * description: 查询TOP8商品和销量
	 *
	 * @author: jackHe
	 * @time: 2020/8/12 12:46
	 */
	List<HotProductResponse> queryHotProduct();

	OrderGoods getGoodsInfoByOrderNo(String orderNo);

    List<OrderGoodsResponse> queryTopTenGoodes();

    Integer updateWzCardNo(JSONObject jsonObject);

    List<JSONObject> queryCardGoods();

    List<JSONObject> querySettOrder(JSONObject jsonObject);

	List<JSONObject> querySettOrderByPay(JSONObject jsonObject);

    List<OrderGoodsResponse> queryByOrderNoAndGoodsCode(@Param("commodityCode") String commodityCode, @Param("orderNo") String orderNo);
}